﻿using LightingPlatform.Tools;
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace LightingPlatform.ViewModel
{
    public class LightingType
    {
        public string Name { get; set; }
        public string PictureUri { get; set; }
        public int UsePlace { get; set; }
        public int Class { get; set; }
        public int Setup { get; set; }
    }

    public class LightingClassModel
    {
        public string ProdLabel { get; set; }
        public string PicFacade { get; set; }
        public string ProdSeries { get; set; }
        public int AdpClass { get; set; }
    }

    public class LightingListModel
    {
        public string PicFacade { get; set; }
        public string ProdSeries { get; set; }
        public string ProdClass { get; set; }
        public string ProdLabel { get; set; }
        public string ProdVersion { get; set; }
        public string PhySize { get; set; }
        public string AdpClass { get; set; }
        public string EleLgtPower { get; set; }
        public string AdpColor { get; set; }
        public string AdpCri { get; set; }
        public string OptAngle { get; set; }
        public string BusMarket { get; set; }
        public int ID { get; set; }
    }

    public class LightingPrimaryModel
    {
        public int ID { get; set; }
        public string ProdSeries { get; set; }
        public string ProdClass { get; set; }
        public string ProdPlace { get; set; }
        public string ProdVersion { get; set; }
        public string ProdLabel { get; set; }
        public string PhyColor { get; set; }
        public string PhySize { get; set; }
        public string PhyDefend { get; set; }
        public string PhyImpact { get; set; }
        public string AdpClass { get; set; }
        public string AdpColor { get; set; }
        public string EleLgtPower { get; set; }
        public string AdpCri { get; set; }
        public string OptAngle { get; set; }
        public string ProjSetup { get; set; }
        public double BusMarket { get; set; }
        public string PicFacade { get; set; }
    }

    public class LightingModel : NotifyingObject
    {
        public int Id { get; set; }

        private int _prodClass;
        public int ProdClass
        {
            get
            {
                return _prodClass;
            }
            set
            {
                _prodClass = value;
                this.RaisePropertyChanged("ProdClass");
            }
        }

        private int _prodPlace;

        /// <summary>
        /// 主要信息：使用场所
        /// </summary>
        public int ProdPlace
        {
            get
            {
                return _prodPlace;
            }
            set
            {
                _prodPlace = value;
                this.RaisePropertyChanged("ProdPlace");
            }
        }

        private int _prodOrgin;
        public int ProdOrgin
        {
            get
            {
                return _prodOrgin;
            }
            set
            {
                _prodOrgin = value;
                this.RaisePropertyChanged("ProdOrgin");
            }
        }

        private string _prodSeries;
        public string ProdSeries
        {
            get
            {
                return _prodSeries;
            }
            set
            {
                _prodSeries = value;
                this.RaisePropertyChanged("ProdSeries");
            }
        }
        private string _prodVersion;
        public string ProdVersion
        {
            get
            {
                return _prodVersion;
            }
            set
            {
                _prodVersion = value;
                this.RaisePropertyChanged("ProdVersion");
            }
        }
        private string _prodLabel;
        public string ProdLabel
        {
            get
            {
                return _prodLabel;
            }
            set
            {
                _prodLabel = value;
                this.RaisePropertyChanged("ProdLabel");
            }
        }

        private int _phyImpact;
        public int PhyImpact
        {
            get
            {
                return _phyImpact;
            }
            set
            {
                _phyImpact = value;
                this.RaisePropertyChanged("PhyImpact");
            }
        }

        private double _phyWeight;
        public double PhyWeight
        {
            get
            {
                return _phyWeight;
            }
            set
            {
                _phyWeight = value;
                this.RaisePropertyChanged("PhyWeight");
            }
        }

        private string _phyColor;
        public string PhyColor
        {
            get
            {
                return _phyColor;
            }
            set
            {
                _phyColor = value;
                this.RaisePropertyChanged("PhyColor");
            }
        }

        private string _phySize;
        public string PhySize
        {
            get
            {
                return _phySize;
            }
            set
            {
                _phySize = value;
                this.RaisePropertyChanged("PhySize");
            }
        }

        private string _phyDefend;
        public string PhyDefend
        {
            get
            {
                return _phyDefend;
            }
            set
            {
                _phyDefend = value;
                this.RaisePropertyChanged("PhyDefend");
            }
        }

        private string _phyMaterial;
        public string PhyMaterial
        {
            get
            {
                return _phyMaterial;
            }
            set
            {
                _phyMaterial = value;
                this.RaisePropertyChanged("PhyMaterial");
            }
        }

        private int _adpOutput;
        public int AdpOutput
        {
            get
            {
                return _adpOutput;
            }
            set
            {
                _adpOutput = value;
                this.RaisePropertyChanged("AdpOutput");
            }
        }
        private int _adpClass;
        public int AdpClass
        {
            get
            {
                return _adpClass;
            }
            set
            {
                _adpClass = value;
                this.RaisePropertyChanged("AdpClass");
            }
        }

        private int _adpCri;
        public int AdpCri
        {
            get
            {
                return _adpCri;
            }
            set
            {
                _adpCri = value;
                this.RaisePropertyChanged("AdpCri");
            }
        }

        private string _adpVersion;
        public string AdpVersion
        {
            get
            {
                return _adpVersion;
            }
            set
            {
                _adpVersion = value;
                this.RaisePropertyChanged("AdpVersion");
            }
        }

        private string _adpPins;
        public string AdpPins
        {
            get
            {
                return _adpPins;
            }
            set
            {
                _adpPins = value;
                this.RaisePropertyChanged("AdpPins");
            }
        }

        private int _adpColor;
        public int AdpColor
        {
            get
            {
                return _adpColor;
            }
            set
            {
                _adpColor = value;
                this.RaisePropertyChanged("AdpColor");
            }
        }

        private int _elePower;
        public int ElePower
        {
            get
            {
                return _elePower;
            }
            set
            {
                _elePower = value;
                this.RaisePropertyChanged("ElePower");
            }
        }
        private int _eleAllPower;
        public int EleAllPower
        {
            get
            {
                return _eleAllPower;
            }
            set
            {
                _eleAllPower = value;
                this.RaisePropertyChanged("EleAllPower");
            }
        }

        private int _eleCtlType;
        public int EleCtlType
        {
            get
            {
                return _eleCtlType;
            }
            set
            {
                _eleCtlType = value;
                this.RaisePropertyChanged("EleCtlType");
            }
        }

        private int _eleLgtPower;
        public int EleLgtPower
        {
            get
            {
                return _eleLgtPower;
            }
            set
            {
                _eleLgtPower = value;
                this.RaisePropertyChanged("EleLgtPower");
            }
        }

        private int _eleVoltage;
        public int EleVoltage
        {
            get
            {
                return _eleVoltage;
            }
            set
            {
                _eleVoltage = value;
                this.RaisePropertyChanged("EleVoltage");
            }
        }

        private string _eleShock;
        public string EleShock
        {
            get
            {
                return _eleShock;
            }
            set
            {
                _eleShock = value;
                this.RaisePropertyChanged("EleShock");
            }
        }

        private string _eleType;
        public string EleType
        {
            get
            {
                return _eleType;
            }
            set
            {
                _eleType = value;
                this.RaisePropertyChanged("EleType");
            }
        }

        private int _optExplain;
        public int OptExplain
        {
            get
            {
                return _optExplain;
            }
            set
            {
                _optExplain = value;
                this.RaisePropertyChanged("OptExplain");
            }
        }

        private double _optEff;
        public double OptEff
        {
            get
            {
                return _optEff;
            }
            set
            {
                _optEff = value;
                this.RaisePropertyChanged("OptEff");
            }
        }

        private string _optAngle;
        public string OptAngle
        {
            get
            {
                return _optAngle;
            }
            set
            {
                _optAngle = value;
                this.RaisePropertyChanged("OptAngle");
            }
        }

        private int _projSetup;
        public int ProjSetup
        {
            get
            {
                return _projSetup;
            }
            set
            {
                _projSetup = value;
                this.RaisePropertyChanged("ProjSetup");
            }
        }
        private string _projParts;
        public string ProjParts
        {
            get
            {
                return _projParts;
            }
            set
            {
                _projParts = value;
                this.RaisePropertyChanged("ProjParts");
            }
        }

        private string _projSize;
        public string ProjSize
        {
            get
            {
                return _projSize;
            }
            set
            {
                _projSize = value;
                this.RaisePropertyChanged("ProjSize");
            }
        }

        private string _projReport;
        public string ProjReport
        {
            get
            {
                return _projReport;
            }
            set
            {
                _projReport = value;
                this.RaisePropertyChanged("ProjReport");
            }
        }

        private string _projBaikup;
        public string ProjBaikup
        {
            get
            {
                return _projBaikup;
            }
            set
            {
                _projBaikup = value;
                this.RaisePropertyChanged("ProjBaikup");
            }
        }
        private double _busMarket;
        public double BusMarket
        {
            get
            {
                return _busMarket;
            }
            set
            {
                _busMarket = value;
                this.RaisePropertyChanged("BusMarket");
            }
        }

        private double _busIn;
        public double BusIn
        {
            get
            {
                return _busIn;
            }
            set
            {
                _busIn = value;
                this.RaisePropertyChanged("BusIn");
            }
        }

        private double _busOut;
        public double BusOut
        {
            get
            {
                return _busOut;
            }
            set
            {
                _busOut = value;
                this.RaisePropertyChanged("BusOut");
            }
        }

        private string _busExpires;
        public string BusExpires
        {
            get
            {
                return _busExpires;
            }
            set
            {
                _busExpires = value;
                this.RaisePropertyChanged("BusExpires");
            }
        }

        private string _picFacade;
        public string PicFacade
        {
            get
            {
                return _picFacade;
            }
            set
            {
                _picFacade = value;
                this.RaisePropertyChanged("PicFacade");
            }
        }

        private string _picSize;
        public string PicSize
        {
            get
            {
                return _picSize;
            }
            set
            {
                _picSize = value;
                this.RaisePropertyChanged("PicSize");
            }
        }

        private string _picGrading;
        public string PicGrading
        {
            get
            {
                return _picGrading;
            }
            set
            {
                _picGrading = value;
                this.RaisePropertyChanged("PicGrading");
            }
        }

        private string _picLive;
        public string PicLive
        {
            get
            {
                return _picLive;
            }
            set
            {
                _picLive = value;
                this.RaisePropertyChanged("PicLive");
            }
        }
    }

    public class PictureConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return new BitmapImage(new Uri(value.ToString(), UriKind.RelativeOrAbsolute));
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
